package com.example.recyclerimageload;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.recyclerimageload.adapter_flipper.AdapterFlipperActivity;
import com.example.recyclerimageload.glide_load_img.RecyclerActivity;
import com.example.recyclerimageload.recyclerview_group.GroupActivity;
import com.example.recyclerimageload.recyclerview_refresh_load_more.activity.MoreActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button mBtRecycler;
    private Button flipper;
    private Button group;
    private Button loadMore;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mBtRecycler = ((Button) findViewById(R.id.bt_recycler));
        flipper = ((Button) findViewById(R.id.bt_flipper));
        group = ((Button) findViewById(R.id.bt_group));
        loadMore = ((Button) findViewById(R.id.bt_load_more));

        loadMore.setOnClickListener(this);
        group.setOnClickListener(this);
        flipper.setOnClickListener(this);
        mBtRecycler.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_recycler:
                Intent intent = new Intent(this, RecyclerActivity.class);
                startActivity(intent);
                break;
            case R.id.bt_flipper:
                Intent flipper = new Intent(this, AdapterFlipperActivity.class);
                startActivity(flipper);
                break;
            case R.id.bt_group:
                Intent group = new Intent(this, GroupActivity.class);
                startActivity(group);
                break;
            case R.id.bt_load_more:
                Intent more = new Intent(this, MoreActivity.class);
                startActivity(more);
                break;
        }
    }
}